package com.anycl.design.j2ee.frontcontroller;

/**
 * 调度器
 */
public class Dispatcher {
    private UserView userView;
    private LogoutView logoutView;

    public Dispatcher(UserView userView, LogoutView logoutView) {
        this.userView = userView;
        this.logoutView = logoutView;
    }

    /**
     * 调度方法
     * @param request 请求
     */
    public void dispatch(String request){
        if (request.equalsIgnoreCase("user")) {
            userView.show();
        } else if (request.equalsIgnoreCase("logout")) {
            logoutView.show();
        }
    }
}
